home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / ddj9304.zip / WAVELET.ZIP / DRAWIMAG.L < prev    next >
Text File  |  1992-02-07  |  13KB  |  296 lines

  1.  
  2. Creation date: Fri Feb 07 09:07:11 1992    drawimag.s    page 1
  3.  
  4.  
  5. Address    Instruction    Line #    Source line
  6.             1    #include "dsp_type.h"
  7.             1    #define DSP32 1
  8.             2    #if DSP32
  9.             3    #include "dspregs.h"
  10.             1    /* dspregs.h */
  11.             2    /* register file redefinition */
  12.             3    #define  r1e   r1
  13.             4    #define  r2e   r2
  14.             5    #define  r3e   r3
  15.             6    #define  r4e   r4
  16.             7    #define  r5e   r5
  17.             8    #define  r6e   r6
  18.             9    #define  r7e   r7
  19.             10    #define  r8e   r8
  20.             11    #define  r9e   r9
  21.             12    #define  r10e  r10
  22.             13    #define  r11e  r11
  23.             14    #define  r12e  r12
  24.             15    #define  r13e  r13
  25.             16    #define  r14e  r14
  26.             17    #define  r15e  r15
  27.             18    #define  r16e  r16
  28.             19    #define  r17e  r17
  29.             20    #define  r18e  r18
  30.             21    #define  r19e  r19
  31.             22    #define  r20e  r20
  32.             23    #define  r21e  r21
  33.             24    
  34.             25    /* integer and float redefinition */
  35.             26    #define  int24  int
  36.             27    #define  float24  float
  37.             4    #endif
  38.             5    
  39.             6    .global DRAWIMAG
  40.             7            /*  DRAWIMAG
  41.             8                draw image of supplied point and connect to previous point
  42.             9                registers used: r1 r2 r3 r4 r5 r6 r7 r12 r13 r14
  43.             10                accumulators used: a0 a1
  44.             11    
  45.             12                input: r12 - pointer to data pointer array
  46.             13                       r13 - pointer to stack
  47.             14                       r14 - return stack register, i.e. "TOP OF STACK"
  48.             15                       a0 - data point to draw
  49.             16            */
  50. 0000    2099ff87    17    DRAWIMAG: a0 = *r12++ - a0 * *r12++; /* multiply by scalling coefficient */
  51. 0004    35380007    18              a1 = -a0 + *r12;    /* determine if value above upper threshold */
  52. 0008    7a803387    19              a0 = ifalt(*r12++); /* if true, limit data to threshold */
  53. 000c    34b80007    20              a1 = a0 - *r12;     /* determine if value below lower threshold */
  54. 0010    7a803387    21              a0 = ifalt(*r12++); /* if true, limit data to threshold */
  55. 0014    79800067    22              *r12++ = a0 = int(a0); /* convert data to integer format */
  56. 0018    00000000    23              nop;
  57. 001c    14ccfffe    24              r6e = r12 - 2;        /* point to temporary storage */
  58. 0020    1ea10197    25              r1 = *r12++;          /* load the row increment value */
  59. 0024    1ea40197    26              r4 = *r12++;          /* load the row baseline offset value */
  60. 0028    1ea20197    27              r2 = *r12++;          /* load the bit pointer */
  61. 002c    1ea30190    28              r3e = *r12;           /* load the byte column pointer */
  62. 0030    1ea600d0    29              r6 = *r6;             /* read the new byte column pointer offset */
  63. 0034    1ae20080    30              r2 - 0x80;            /* check if first bit of new byte column */
  64. 0038    008000a0    31              if (ne) goto ADD_BAR; /* if true, add new bar to byte column */
  65. 003c    00000000    32              nop;
  66.  
  67.  
  68. Creation date: Fri Feb 07 09:07:12 199    drawimag.s    page 2
  69.  
  70.  
  71. Address    Instruction    Line #    Source line
  72.             76    #else
  73. 0040    182600c0    77              r6 = r6 * 2;     /* multiply offset by four to account for ... */
  74. 0044    182600c0    78              r6 = r6 * 2;     /* four bytes per instruction in MEMSET */
  75. 0048    1ae6005c    79              r6 - 92;         /* check if datum point is above baseline */
  76. 004c    01a00064    80              if (le) goto ABOVE_BL; /* if true, it is above the baseline */
  77. 0050    18a500c0    81              r5 = -r6;      /* middle counter for draw of bar pixels */
  78. 0054    14800000    82              r4 = 0;        /* top counter for clearing of pixel over bar */
  79. 0058    14a500c4    83              r5 = r5 + 196; /* middle counter for draw of bar pixels */
  80. 005c    00200074    84              goto DRAW_COL; /* go draw the column of pixels */
  81. 0060    1a86005c    85              r6 = r6 - 92;  /* bottom counter for clearing of pixel under bar */
  82.             86    
  83. 0064    18a400c0    87    ABOVE_BL: r4 = -r6;      /* top counter for clearing of pixel over bar */
  84. 0068    14840064    88              r4 = r4 + 100; /* top counter for clearing of pixel over bar */
  85. 006c    14a60004    89              r5 = r6 + 4;   /* middle counter for draw of bar pixels */
  86. 0070    14c00000    90              r6 = 0;        /* bottom counter for clearing of pixel under bar */
  87. 0074    1fae01b6    91    DRAW_COL: *r13-- = r14;  /* save return address to the stack */
  88. 0078    11c4010c    92              call r4+MEMSET (r14); /* zero the bytes above the bar */
  89. 007c    188700e0    93              r7 = r7 - r7;         /* force the register to zero */
  90. 0080    11c5010c    94              call r5+MEMSET (r14); /* set the bytes of the bar */
  91. 0084    14e20000    95              r7 = r2;              /* MSB of byte is bar, others cleared */
  92. 0088    11c6010c    96              call r6+MEMSET (r14); /* zero the bytes below the bar */
  93. 008c    188700e0    97              r7 = r7 - r7;         /* force the register to zero */
  94. 0090    15ad0002    98              r13 = r13 + 2;        /* point to return address on the stack */
  95. 0094    1eae01b0    99              r14 = *r13;           /* load the return address from the stack */
  96. 0098    002000ec    100    NO_BOT:   goto SHIFTBIT; /* go shift the bit pointer and clear up */
  97. 009c    1ea30190    101              r3 = *r12;     /* reload the byte pointer */
  98.             102    
  99. 00a0    182600c0    103    ADD_BAR:  r6 = r6 * 2;   /* multiply offset by twelve to account for ... */
  100. 00a4    182600c0    104              r6 = r6 * 2;   /* four bytes per instruction and ... */
  101. 00a8    182700c0    105              r7 = r6 * 2;   /* three instructions per byte in MEM_OR */
  102. 00ac    180600e0    106              r6 = r6 + r7;
  103. 00b0    1ae60120    107              r6 - 288;               /* check if datum below baseline */
  104. 00b4    018000c4    108              if (gt) goto BELOW_BL; /* if true, datum is below baseline */
  105. 00b8    1a860120    109              r6 = r6 - 288; /* calculate length of bar */
  106. 00bc    18a600c0    110              r6 = -r6;      /* datum above baseline length was negative */
  107. 00c0    18a10020    111              r1 = -r1;      /* datum above baseline, increment is decrement */
  108. 00c4    1a460120    112    BELOW_BL: r6 = 288 - r6  /* align the counter for proper call */
  109. 00c8    18040060    113              r4 = r4 + r3;  /* add baseline offset to byte column pointer */
  110. 00cc    14a40000    114              r5 = r4;
  111. 00d0    18050020    115              r5 = r5 + r1;  /* move pointer away from the baseline */
  112. 00d4    1fae01b6    116              *r13-- = r14;  /* save return address to the stack */
  113. 00d8    14e00000    117              r7 = 0;        /* zero initial storage value */
  114. 00dc    11c60178    118              call r6+MEM_OR (r14);
  115. 00e0    14c70000    119              r6 = r7;
  116. 00e4    15ad0002    120              r13 = r13 + 2;        /* point to return address on the stack */
  117. 00e8    1eae01b0    121              r14 = *r13;           /* load the return address from the stack */
  118.             122    #endif
  119.             123    
  120. 00ec    19820040    124    SHIFTBIT: r2 = r2 >> 1;    /* shift the pixel pointed to right */
  121. 00f0    00800100    125              if (ne) goto NO_WRAP; /* if true, don't wrap the pixel pointer */
  122. 00f4    1a8c0002    126              r12e = r12 - 2;  /* point to bit pointer storage */
  123. 00f8    14400080    127              r2 = 0x0080;     /* new bit mask if pixel wraps */
  124. 00fc    14630001    128              r3e = r3 + 1;    /* increment base to next byte upon wrap */
  125. 0100    1fa20197    129    NO_WRAP:  *r12++ = r2;     /* save the next bit pointer */
  126. 0104    002e0000    130              return (r14);
  127. 0108    1fa30197    131              *r12++ = r3e;    /* save the next byte pointer start value */
  128.             132            /* END OF DRAWIMAG */
  129.             133    
  130.             134    #if DSP32
  131.             135            /*  MEMSET
  132.  
  133.  
  134. Creation date: Fri Feb 07 09:07:12 199    drawimag.s    page 3
  135.  
  136.  
  137. Address    Instruction    Line #    Source line
  138.             136                set column of image bytes to a given value
  139.             137                registers used: r1 r3 r7 r14
  140.             138    
  141.             139                input: r1 - postincrement value
  142.             140                       r3 - byte column pointer
  143.             141                       r7 - storage value
  144.             142                       r14 - return stack register, i.e. "TOP OF STACK"
  145.             143            */
  146. 010c    1f670061    144    MEMSET:   *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  147. 0110    1f670061    144
  148. 0114    1f670061    144
  149. 0118    1f670061    144
  150. 011c    1f670061    145              *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  151. 0120    1f670061    145
  152. 0124    1f670061    145
  153. 0128    1f670061    145
  154. 012c    1f670061    146              *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  155. 0130    1f670061    146
  156. 0134    1f670061    146
  157. 0138    1f670061    146
  158. 013c    1f670061    147              *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  159. 0140    1f670061    147
  160. 0144    1f670061    147
  161. 0148    1f670061    147
  162. 014c    1f670061    148              *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  163. 0150    1f670061    148
  164. 0154    1f670061    148
  165. 0158    1f670061    148
  166. 015c    1f670061    149              *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;  *r3++r1 = r7l;
  167. 0160    1f670061    149
  168. 0164    1f670061    149
  169. 0168    1f670061    149
  170. 016c    1f670061    150              *r3++r1 = r7l;
  171.             151    
  172. 0170    002e0000    152              return (r14);
  173. 0174    00000000    153              nop;
  174.             154            /* END OF MEMSET */
  175.             155    
  176.             156            /*  MEM_OR
  177.             157                logical OR column of image bytes with a given value
  178.             158                registers used: r1 r4 r5 r6 r7 r14
  179.             159    
  180.             160                input: r1 - postincrement value
  181.             161                       r2 - 'OR' value
  182.             162                       r4 - lagging byte column pointer
  183.             163                       r5 - leading byte column pointer
  184.             164                       r14 - return stack register, i.e. "TOP OF STACK"
  185.             165            */
  186. 0178    1e6600a1    166    MEM_OR:   r6l = *r5++r1;  /* load column byte */
  187. 017c    1f670081    167              *r4++r1 = r7l;  /* save initial 'dummy' value */
  188. 0180    19460040    168              r6 = r6 | r2;   /* 'OR' column byte with byte value */
  189. 0184    1e6700a1    169              r7l = *r5++r1;  /* load the next column byte */
  190. 0188    1f660081    170              *r4++r1 = r6l;  /* save the new column byte value */
  191. 018c    19470040    171              r7 = r7 | r2;   /* 'OR' the next column byte with the byte value */
  192. 0190    1e6600a1    172              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  193. 0194    1f670081    172
  194. 0198    19460040    172
  195. 019c    1e6700a1    173              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  196. 01a0    1f660081    173
  197. 01a4    19470040    173
  198.  
  199.  
  200. Creation date: Fri Feb 07 09:07:12 199    drawimag.s    page 4
  201.  
  202.  
  203. Address    Instruction    Line #    Source line
  204. 01a8    1e6600a1    174              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  205. 01ac    1f670081    174
  206. 01b0    19460040    174
  207. 01b4    1e6700a1    175              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  208. 01b8    1f660081    175
  209. 01bc    19470040    175
  210. 01c0    1e6600a1    176              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  211. 01c4    1f670081    176
  212. 01c8    19460040    176
  213. 01cc    1e6700a1    177              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  214. 01d0    1f660081    177
  215. 01d4    19470040    177
  216. 01d8    1e6600a1    178              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  217. 01dc    1f670081    178
  218. 01e0    19460040    178
  219. 01e4    1e6700a1    179              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  220. 01e8    1f660081    179
  221. 01ec    19470040    179
  222. 01f0    1e6600a1    180              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  223. 01f4    1f670081    180
  224. 01f8    19460040    180
  225. 01fc    1e6700a1    181              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  226. 0200    1f660081    181
  227. 0204    19470040    181
  228. 0208    1e6600a1    182              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  229. 020c    1f670081    182
  230. 0210    19460040    182
  231. 0214    1e6700a1    183              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  232. 0218    1f660081    183
  233. 021c    19470040    183
  234. 0220    1e6600a1    184              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  235. 0224    1f670081    184
  236. 0228    19460040    184
  237. 022c    1e6700a1    185              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  238. 0230    1f660081    185
  239. 0234    19470040    185
  240. 0238    1e6600a1    186              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  241. 023c    1f670081    186
  242. 0240    19460040    186
  243. 0244    1e6700a1    187              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  244. 0248    1f660081    187
  245. 024c    19470040    187
  246. 0250    1e6600a1    188              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  247. 0254    1f670081    188
  248. 0258    19460040    188
  249. 025c    1e6700a1    189              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  250. 0260    1f660081    189
  251. 0264    19470040    189
  252. 0268    1e6600a1    190              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  253. 026c    1f670081    190
  254. 0270    19460040    190
  255. 0274    1e6700a1    191              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  256. 0278    1f660081    191
  257. 027c    19470040    191
  258. 0280    1e6600a1    192              r6l = *r5++r1;  *r4++r1 = r7l;  r6 = r6 | r2;
  259. 0284    1f670081    192
  260. 0288    19460040    192
  261. 028c    1e6700a1    193              r7l = *r5++r1;  *r4++r1 = r6l;  r7 = r7 | r2;
  262. 0290    1f660081    193
  263. 0294    19470040    193
  264.  
  265.  
  266. Creation date: Fri Feb 07 09:07:12 199    drawimag.s    page 5
  267.  
  268.  
  269. Address    Instruction    Line #    Source line
  270. 0298    1e6600a1    194              r6l = *r5++r1;  *r4++r1 = r7l;
  271. 029c    1f670081    194
  272. 02a0    002e0000    195              return (r14);
  273. 02a4    00000000    196              nop;
  274.             197            /* END OF MEMSET */
  275.             198    #endif
  276.  
  277.  
  278. d3as:warning:drawimag.s line 101: branch dest can't start with inst referencing
  279.          reg being loaded
  280.  
  281.  
  282.  
  283. Symbol Table
  284. .file    drawimag.s
  285. .bank0    (section 1)    size 0x2a8
  286. NO_BOT    section 1    defined    value 0x98
  287. MEMSET    section 1    defined    value 0x10c
  288. SHIFTBIT    section 1    defined    value 0xec
  289. BELOW_BL    section 1    defined    value 0xc4
  290. DRAWIMAG    section 1    global    defined    value 0x0
  291. MEM_OR    section 1    defined    value 0x178
  292. ADD_BAR    section 1    defined    value 0xa0
  293. NO_WRAP    section 1    defined    value 0x100
  294. ABOVE_BL    section 1    defined    value 0x64
  295. DRAW_COL    section 1    defined    value 0x74
  296.